import {createRouter, createWebHashHistory} from 'vue-router';
import LoginRegister from "@/components/Common/LoginRegister.vue";
import UserManagement from '@/components/Admin/UserManagement.vue';
import AdminPage from "@/pages/Admin/AdminPage.vue";
import MapManagement from "@/components/Admin/MapManagement.vue";
import DormitoryManagement from "@/components/Admin/DormitoryManagement.vue";
import OrganizationManagement from "@/components/Admin/OrganizationManagement.vue";
import ProfessionalManagement from "@/components/Admin/ProfessionalManagement.vue";
import ScholarshipManagement from "@/components/Admin/ScholarshipManagement.vue";
import AdminManagement from "@/components/Admin/AdminManagement.vue";
import UserPage from "@/pages/User/UserPage.vue";
import DormitoryInformation from "@/components/User/DormitoryInformation.vue";
import UserInformation from "@/components/User/UserInformation.vue";
import OrganizationInformation from "@/components/User/OrganizationInformation.vue";
import ProfessionalInformation from "@/components/User/ProfessionalInformation.vue";
import ScholarshipInformation from "@/components/User/ScholarshipInformation.vue";
import MapInformation from "@/components/User/MapInformation.vue";
import CanteenInformation from "@/components/User/CanteenInformation.vue";
import LoanInformation from "@/components/User/LoanInformation.vue";
import GrantsInformation from "@/components/User/GrantsInformation.vue";
import AdminInitializeComponent from "@/components/Admin/InitializeComponent.vue";
import UserInitializeComponent from "@/components/User/InitializeComponent.vue";
import Test from "@/test/Test.vue";
import Store from "@/store/Store.js";
import {ElMessage} from "element-plus";

// 路由配置
const routes = [{
    path    : '/',
    redirect: '/login-register'
}, {
    path     : '/login-register',
    name     : 'LoginRegister',
    component: LoginRegister
}, {
    path     : '/test',
    name     : 'test',
    component: Test
}, {
    path     : '/Admin',
    name     : 'Admin',
    component: AdminPage,
    children : [{
        path     : 'admin-initialize-component',
        name     : 'AdminInitializeComponent',
        component: AdminInitializeComponent
    }, {
        path     : 'user-initialize-component',
        name     : 'UserInitializeComponent',
        component: UserInitializeComponent
    }, {
        path     : 'admin-management',
        name     : 'AdminManagement',
        component: AdminManagement
    }, {
        path     : 'dormitory-management',
        name     : 'DormitoryManagement',
        component: DormitoryManagement
    }, {
        path     : 'user-management',
        name     : 'UserManagement',
        component: UserManagement
    }, {
        path     : 'organization-management',
        name     : 'OrganizationManagement',
        component: OrganizationManagement
    }, {
        path     : 'professional-management',
        name     : 'ProfessionalManagement',
        component: ProfessionalManagement
    }, {
        path     : 'scholarship-management',
        name     : 'ScholarshipManagement',
        component: ScholarshipManagement
    }, {
        path     : 'map-management',
        name     : 'MapManagement',
        component: MapManagement
    }, {
        path     : 'initialize-component',
        name     : 'InitializeComponent',
        component: AdminInitializeComponent
    }]
}, {
    path     : '/User',
    name     : 'User',
    component: UserPage,
    children : [{
        path     : 'dormitory-information',
        name     : 'DormitoryInformation',
        component: DormitoryInformation
    }, {
        path     : 'user-information',
        name     : 'UserInformation',
        component: UserInformation
    }, {
        path     : 'organization-information',
        name     : 'OrganizationInformation',
        component: OrganizationInformation
    }, {
        path     : 'professional-information',
        name     : 'ProfessionalInformation',
        component: ProfessionalInformation
    }, {
        path     : 'scholarship-information',
        name     : 'ScholarshipInformation',
        component: ScholarshipInformation
    }, {
        path     : 'map-information',
        name     : 'MapInformation',
        component: MapInformation
    }, {
        path     : 'canteen-information',
        name     : 'CanteenInformation',
        component: CanteenInformation
    }, {
        path     : 'loan-information',
        name     : 'LoanInformation',
        component: LoanInformation
    }, {
        path     : 'grants-information',
        name     : 'GrantsInformation',
        component: GrantsInformation
    }, {
        path     : 'initialize-component',
        name     : 'InitializeComponent',
        component: UserInitializeComponent
    }]
}];

const router = createRouter({
    history: createWebHashHistory(),
    routes,
});


export default router;
